<template>
	<view>
		<view class="goods_list">
			<view class="item" v-for="item in goodsList" :key="item.id" @click="handleGoodsInfo(item.id)">
				<image :src="item.img_url" mode="widthFill"></image>
				<view class="title_wrap">{{item.title}}</view>
				<view class="price">
					￥{{item.market_price}}<text>￥{{item.sell_price}}</text></view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			goodsList:Array
		},
		data() {
			return {
				
			};
		},
		methods:{
			handleGoodsInfo(id){
				uni.navigateTo({
					url:`../goodsDetail/goodsDetail?id=${id}`
				})
			}
		}
	}
</script>

<style lang="scss">
.goods_list{
		background-color: #ccc;
		display: flex;
		align-items: center;
		flex-wrap: wrap;
		.item{
			width: 50%;
			padding: 5px;
			border: 5px solid #ccc;
			border-bottom: none;
			background-color: #fff;
			font-size: 14px;
			&:nth-child(2n+1){
				border-right: none;
			}
			image{
				display: block;
				width: 130px;
				height: 105px;
				margin: 0 auto;
			}
			.title_wrap{
				display: -webkit-box;
				overflow: hidden;
				text-overflow: ellipsis;
				-webkit-line-clamp: 2;
				-webkit-box-orient: vertical;
				word-break: break-all;
				color: #000;
				text-align: left;
			}
			.price{
				color: $color;
				font-size: 18px;
				padding-right: 10px;
				text{
					color: #666;
					font-size: 14px;
					text-decoration: line-through;
				}
			}
		}
	}
</style>
